package cn.lzy.Security.Memory;

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * @Author: WeiKaiYe
 * @CreateTime: 2023-10-10  21:37
 */

/*@EnableWebSecurity    // 开启 MVC Security 安全支持
public class MemorySecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        // 设置密码编辑器
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        // 使用内存用户信息，作为测试
        auth.inMemoryAuthentication().passwordEncoder(encoder).withUser("Lili")
                .password(encoder.encode("123456")).roles("common").and()
                .withUser("糖果").password(encoder.encode("123456")).roles("vip");
    }
}*/
